package com.yh.csx.bsf.ods;

import ch.qos.logback.classic.LoggerContext;
import lombok.var;
import org.slf4j.ILoggerFactory;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Config {
    @Bean
    LogFilter getLogFilter() {
        var filter = new LogFilter();
        ILoggerFactory factory = LoggerFactory.getILoggerFactory();
        LoggerContext context = ((LoggerContext) factory);
        context.getLogger("ROOT").getAppender("CONSOLE").addFilter(filter);
        return new LogFilter();
    }
}
